package com.we.connect.weconnect.model.common;

import lombok.Data;
import org.springframework.ui.Model;

@Data
public class ResultModel {

    public static Model success(String message, String tip, String url, Model model) {
        model.addAttribute("message", message);
        model.addAttribute("code", "success");
        model.addAttribute("tip", tip);
        model.addAttribute("url", url);
        return model;
    }

    public static Model fail(String message, String tip, String url, Model model) {
        model.addAttribute("message", message);
        model.addAttribute("code", "fail");
        model.addAttribute("tip", tip);
        model.addAttribute("url", url);
        return model;
    }
}
